<%@ page language="java" contentType="text/html; charset=UTF-8" 
pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<script type="text/javascript">
function changeProduct() {
	var ids = '';
	var count = 0;
	var status = '';
	$('input:checkbox[name="ids"]:checked',navTab.getCurrentPanel()).each(function(i, n) {
		ids = n.value;
		count += count+1;
	});
	if(count == 0) {
		alert('请选择你要变更的信息！');
		return ;
	}
	else if(count > 1) {
		alert('只能选择一条信息进行变更！');
		return ;		
	}else{
		 	var navTabId = navTab._getTabs().filter('.selected').attr('tabid');
			navTab.openTab("listproduct", "${path }/borrowinfo/borrowinfoAction!addBorrowinfo.action?id="+ids+"&navTabId="+navTabId, { title:"变更", fresh:false, data:{} });
	}
	
	}
</script>

<div class="tip">
	<span>资产借用查询</span>
</div>
<div class="pageHeader">
	
	<form onsubmit="return navTabSearch(this);" action=""  method="post" rel="pagerForm" id="pagerFindForm">
		<div class="searchBar">
			<table class="pageFormContent">
				<tr>
				 
				<td>
					<label>借用状态：</label>
					<select name="filter_and_state_EQ_S"  rel="iselect">
						<option value="">请选择</option>
						<option value="1010105">借用中</option>
						<option value="1010101">已归还</option>		
					</select>
				</td>
				 </tr>
				 <tr>
				
				
				 <td>
				<label>借用日期：</label>
				<input type="text" name="filter_and_startTime_GEST_T"  id="d1" style="width: 170px;" onFocus="WdatePicker({minDate:'2000-01-01',maxDate:'#F{$dp.$D(\'d2\')}'})"  readonly="readonly" value="${filter_and_startTime_GEST_T}" /><a class="inputDateButton" href="javascript:;" >选择</a>
			</td>
			<td>
				<label>至：</label>
				<input type="text" name="filter_and_startTime_LEET_T" id="d2" style="width: 170px;" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d1\')}'})"  readonly="readonly" value="${filter_and_startTime_LEET_T}" /><a class="inputDateButton" href="javascript:;">选择</a>
			</td>
				
					<td>
					<div class="buttonActive"><div class="buttonContent"><button type="submit">查找</button></div></div>
					<div class="buttonActive"><div class="buttonContent"><button type="button" id="clearText">重置</button></div></div>
					</td>
				</tr>
			</table>
		</div>
		<h3 align="center">资产借用信息 </h3>
	</form>
</div>
<div class="pageContent">
	
	<div class="panelBar">
			
			<ul class="toolBar">
			<li><a class="edit" onclick="changeProduct()" style="cursor:pointer;"><span>修改</span></a></li>
			<li><a class="delete" href="${path}/borrowinfo/borrowinfoAction!deleteBorrowinfo.action"  rel="ids" postType="string" title="确定要删除吗?" target="selectedTodo"><span>删除</span></a></li>
				<web:exportExcelTag pagerFormId="pagerFindForm"
					pagerMethodName="findByPage"
					actionAllUrl="org.hpin.asset.web.BorrowinfoAction"
					informationTableId="exportExcelTable" 
					fileName="borrowinfo"></web:exportExcelTag>
			</ul>	
					
			
		<jsp:include page="/common/pagination.jsp" />
	</div>
	<table class="list" width="100%" layoutH="150" id="exportExcelTable">
		<thead>
			<tr>
			<th><nobr>序号</nobr></th>
			<th export = "true" columnEnName ="department" columnChName = "借用部门">借用部门</th>
			<th export = "true" columnEnName = "borrower" columnChName = "借用人" >借用人</th>
			<th export = "true" columnEnName = "startTime" columnChName = "借用时间">借用时间</th>
			<th export = "true" columnEnName = "deviceName" columnChName = "设备名称">设备名称</th>
			<th export = "true" columnEnName = "endTime"  columnChName = "结束时间">结束时间</th>
			<th export = "true" columnEnName = "reason" columnChName = "借用原因">借用原因</th>
			<th export = "true" columnEnName = "state" id2NameBeanId = "org.hpin.base.dict.dao.SysDictTypeDao" columnChName = "状态">状态</th>
		
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${ page.results }" var="borrowinfo"  varStatus="status">
				<tr target="sid_user" rel="${borrowinfo.id }">
					<th><input type="checkbox" name="ids" value="${borrowinfo.id }" >${status.count }</th>
					<td align="center" nowrap="nowrap">${borrowinfo.department}</td>
					<td align="center">${borrowinfo.borrower}</td> 
					<td align="center"><fmt:formatDate  value="${borrowinfo.startTime}" pattern="yyyy/MM/dd" /> </td> 
					<td align="center"><a href="${ path }/assetinfo/assetinfoAction!browAssetinfo.action?id=${borrowinfo.assetno }"  target="dialog">${borrowinfo.deviceName}</a></td> 
					<td align="center"><fmt:formatDate  value="${borrowinfo.endTime}" pattern="yyyy/MM/dd" /> </td> 
					<td align="center">${borrowinfo.reason}</td> 
					<td align="center"><hpin:id2nameDB beanId="org.hpin.base.dict.dao.SysDictTypeDao" id="${borrowinfo.state}"/>
					</td> 
				</tr>
			</c:forEach>
		</tbody>
	</table>
</div>
